/*
 * app_uartcom.h
 *
 *  Created on: Nov 8, 2013
 *      Author: Omar Sevilla
 */

#ifndef APP_UARTCOM_H_
#define APP_UARTCOM_H_

/*
 * En esta parte es donde se agregan las definiciones.
 * Recomiendo que uses los DEFINE algo asi como:
 * 
 * #define RED 0x30 
 * 
 * por ejemplo
 */
/*Defines for State Machine*/
#define SYNC_SEND		0x00
#define CMD_SEND		0x01
#define	CHKSUM_SEND		0x02

/*Commands Defines*/
//SYNC
#define	SYNC_CMD		(char) 0xA5
//Table of Commands*****************************************//
//(MODES)													//
#define OFF_CMD				0x10							//
#define SECUENCIAL_CMD		0x11							//
#define ANALOG_CMD			0x12							//
//////////////////////////////////////////////////////////////
//(LED SELECTION)											//
#define RED_SELECT_CMD		0x0A							//
#define	GREEN_SELECT_CMD	0x0B							//
#define BLUE_SELECT_CMD		0x0C							//
//////////////////////////////////////////////////////////////
//(PWM)														//
#define PWM_CMD(PWM_VAL)			(0x80 | PWM_VAL)		//
#define PWMCMD				0x80
//End Of Table**********************************************//

#define RED_SELECTED		0x00
#define GREEN_SELECTED		0x01
#define	BLUE_SELECTED		0x02

void cmd_mng(void);
void app_chksum(void);
void cmd_exc(T_UBYTE lub_cmd);

#endif /* APP_UARTCOM_H_ */
